package ita.class1.group2.supermarket.merchant.controller;

import ita.class1.group2.supermarket.common.annotation.Component;
import ita.class1.group2.supermarket.common.annotation.RequestMapping;
import ita.class1.group2.supermarket.common.util.FileUtil;

import java.io.File;
import java.util.Map;

@Component
public class StaticResourceController {

    @RequestMapping("/res/{fileName}")
    public File getResource(Map<String, String> params) throws Exception {
        return new File(FileUtil.getUploadFolder(), params.get("fileName"));
    }

}
